package org.lanqiao.service;

import java.util.List;

import org.lanqiao.dao.CartDaoImpl;
import org.lanqiao.pojo.CartListPOJO;

public class CartServiceImpl {
	
	CartDaoImpl cart = new CartDaoImpl();
	
	/**
	 * 1.加入购物车
	 */	
	public int addCart(String userId,String productId,String productCount,String totalPrice) {
		return cart.addCart(userId,productId,productCount,totalPrice);
	}
	
	/**
	 * 2.查询购物车
	 */
	
	public List selectAllCart(String userId) {
		return cart.SelectAllCart(userId);
		
	}
	
	/**
	 * 3.删除购物车,
	 */
	public List delete(String carId,String userId ) {
		 int  a = cart.deleteCart(carId);
		 return  cart.SelectAllCart(userId);
	}
	
	
	/**
	 * 4.更改商品的数量
	 */
	
	public List update(CartListPOJO cartlist,String userId ) {
		int a = cart.updateCart(cartlist);
		return cart.SelectAllCart(userId);
	}
	
	
	
}
